//
//  ViewController.m
//  IOS-anim-frame
//
//  Created by RIOS on 2018/4/2.
//  Copyright © 2018年 RIOS. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()
@property (weak, nonatomic) IBOutlet UIImageView *image;
@property (weak, nonatomic) IBOutlet UIButton *btn;
- (IBAction)gotoAnim:(id)sender;

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


- (IBAction)gotoAnim:(id)sender {
    NSMutableArray *marray = [NSMutableArray array];
    for (int i=0; i< 8; i++) {
        NSString *name = [NSString stringWithFormat:@"icon%d",i+1];
        UIImage *image = [UIImage imageNamed:name];
        [marray addObject:image];
    }
    
    self.image.animationImages  = marray;
    self.image.animationDuration = 3;
    self.image.animationRepeatCount = 3;
    [self.image startAnimating];
    
    NSLog(@"count:%ld",self.image.animationImages.count);
    
//    [self.image performSelector:@selector(setIcon) withObject:nil afterDelay:self.image.animationImages.count *  ];
    
}











@end
